﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UYD_WCS_AS_AGV_Controller.BaseClass
{
    public class Log
    {
        static log4net.ILog logWcsInfo = log4net.LogManager.GetLogger("LogWcsInfo"); //Logging 名字要在 App.config 中能找到
        static log4net.ILog logSysRun = log4net.LogManager.GetLogger("LogSysRun"); //Logging 名字要在 App.config 中能找到
        static log4net.ILog logAgv = log4net.LogManager.GetLogger("LogAgv"); //Logging 名字要在 App.config 中能找到
        static log4net.ILog logFork = log4net.LogManager.GetLogger("LogFork"); //Logging 名字要在 App.config 中能找到

        public static void saveToLog(object lt ,string msg)
        {
            lt = (Enum)lt;
            switch ((int)lt)
            {
                case (int)locType.Wcs:
                    logWcsInfo.Debug(msg);
                    break;
                case (int)locType.Sys:
                    logSysRun.Info(msg);
                    break;
                case (int)locType.Agv:
                    logAgv.Info(msg);
                    break;
                case (int)locType.Fork:
                    logFork.Info(msg);
                    break;
            }
        }

        public enum locType
        {
            Wcs=1,
            Sys=2,
            Agv=3,
            Fork=4
        }

    }
}
